﻿using UnityEngine;
using System.Collections;

public class FxController : MonoBehaviour {

    public GameObject[] ArrayParticle;

    public GameObject boss;

    public float healthHideParticle;

    public int indexHideParticle;

    private EnemyController enemyController;

    void Awake()
    {
        enemyController = boss.GetComponent<EnemyController>();
    }

    void Update()
    {
        if (enemyController.status.Health == healthHideParticle)
        {
            for (int i = 0; i < ArrayParticle.Length; i++)
            {
                if (i < indexHideParticle)
                {
                    ArrayParticle[i].SetActive(false);
                }
                else
                {
                    ArrayParticle[i].SetActive(true);
                }
            }
        }
    }


}
